/**
 * @Auther: ChenforCode
 * @Date: 2018/9/11 12:07
 * @Description:
 */
package cn.chenforcode.entity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.sql.Timestamp;

@Entity
public class Borrow {
    private String sno;
    private String bno;
    private Timestamp bordate;
    private Timestamp retdate;


    @Basic
    @Column(name = "SNO")
    public String getSno() {
        return sno;
    }

    public void setSno(String sno) {
        this.sno = sno;
    }

    @Basic
    @Column(name = "BNO")
    public String getBno() {
        return bno;
    }

    public void setBno(String bno) {
        this.bno = bno;
    }

    @Id
    @Column(name = "BORDATE")
    public Timestamp getBordate() {
        return bordate;
    }

    public void setBordate(Timestamp bordate) {
        this.bordate = bordate;
    }

    @Basic
    @Column(name = "RETDATE")
    public Timestamp getRetdate() {
        return retdate;
    }

    public void setRetdate(Timestamp retdate) {
        this.retdate = retdate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Borrow borrow = (Borrow) o;

        if (sno != null ? !sno.equals(borrow.sno) : borrow.sno != null) return false;
        if (bno != null ? !bno.equals(borrow.bno) : borrow.bno != null) return false;
        if (bordate != null ? !bordate.equals(borrow.bordate) : borrow.bordate != null) return false;
        if (retdate != null ? !retdate.equals(borrow.retdate) : borrow.retdate != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = sno != null ? sno.hashCode() : 0;
        result = 31 * result + (bno != null ? bno.hashCode() : 0);
        result = 31 * result + (bordate != null ? bordate.hashCode() : 0);
        result = 31 * result + (retdate != null ? retdate.hashCode() : 0);
        return result;
    }

    public Borrow(String sno, String bno, Timestamp bordate, Timestamp retdate) {
        this.sno = sno;
        this.bno = bno;
        this.bordate = bordate;
        this.retdate = retdate;
    }

    public Borrow() {
    }

    @Override
    public String toString() {
        return "Borrow{" +
                "sno='" + sno + '\'' +
                ", bno='" + bno + '\'' +
                ", bordate=" + bordate +
                ", retdate=" + retdate +
                '}';
    }
}
